import 'package:bloc/bloc.dart';

class ChatEvent {
  final String text;
  ChatEvent(this.text);
}

class ChatBloc extends Bloc<ChatEvent, String> {
  // 对方id
  final int targetId;
  // 对方昵称
  final String targetName;
  // 对方头像
  final String targetHead;
  // 对方token
  final String targetToken;

  ChatBloc({
    this.targetId,
    this.targetHead,
    this.targetName,
    this.targetToken,
  });

  @override
  Stream<String> mapEventToState(ChatEvent event) async* {
    yield event.text;
  }

  @override
  String get initialState => "";
}
